1. Field Of The Invention
The present invention relates to image processing. More particularly, the present invention relates to a method and apparatus for image contrast modulation by interpolation with segmented lines.
2. Background
Typically, video data must be scaled during video processing because the source image size may differ from the display size. An image is xe2x80x9cstretchedxe2x80x9d when pixels are added to a source image having a lower resolution to create a second image having a higher resolution. Pixels added to the second image must be assigned an intensity value. The intensity values may be grayscales or color component values. Preferably, the intensity values for the pixels added to the stretched image are selected such that the contrast properties of the source image are preserved, without introducing artifacts.
The simplest form of image stretching is pixel duplication or nearest neighbor, where a pixel from the source image is copied to the new image. For example, a 1:2 stretching of an image results in a new image which contains two copies of every pixel in the source image. Similarly, a 1:1.5 stretching of an image results in a new image which contains two copies of one out of every two pixels in the source image. The copied pixels have the same intensity values. This technique requires minimal hardware to implement, but it results in relatively poor image quality. The poor image quality includes the introduction of stair-stepping, false colors, missing edges and other artifacts.
An improvement in video quality of scaled images is possible using linear interpolation. Bilinear interpolation combines the linear interpolation process in both the horizontal and vertical directions. When an output sample falls between two input samples (horizontally or vertically), the output sample is computed by linearly interpolating between the two input samples.
Other approaches for determining intensity values in scaled images include using higher order interpolation. Generally, the higher the order of the interpolation, n, the better the overall quality of the resultant image. For the purposes of this disclosure, the term higher order interpolation refers to second or higher order polynomial curve fitting. Higher order interpolation requires significantly more hardware and memory bandwidth than pixel duplication or linear interpolation. The hardware typically required to implement such prior art techniques is shown in Table 1 below.
The pixel duplication and nearest neighbor methods require a minimum amount of hardware, but yield relatively low quality images. Linear interpolation requires additional hardware and yields better quality images, but data is still blurred and the high frequency content of images is not adequately preserved. Nth order interpolation yields significantly better images and preserves a broader range of frequency content, but requires much more hardware. The additional hardware required includes more multipliers and more line buffers to hold lines of pixel data. Higher order interpolations are performed over larger pixel areas, requiring a corresponding increase in the number of buffers that hold the data.
A reduction in the number of line buffers is made possible by performing interpolation on the fly or by using specialized frame buffer interfaces which provide blocks of pixel data rather than lines of pixel data. However, these approaches significantly complicate the design and require many more multipliers in hardware.
A need exists in the prior art for a method and apparatus for scaled image contrast modulation that adequately approximates higher order curves with minimal hardware.
An apparatus for image contrast modulation includes a memory for storing a scaling factor and a memory for storing a pixel position. A pixel determiner calculates the position of another pixel based upon the pixel position and the scaling factor. A segment determiner ascertains which segment of the segmented line contains the pixel position. A coefficient generator determines which coefficient is associated with the line segment. A method for image contrast modulation includes defining at least one multi-segmented line that approximates a higher order curve including more than one pixel in a source image, and line-fitting pixel intensity values in a scaled image according to a multi-segmented line.